package com.training.collections.listex;

import java.util.Iterator;
import java.util.List;
import java.util.Stack;

public class StackEx {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		 
		
		Stack stack = new Stack();
		
		stack.add("Three");
		stack.add("Two");
		stack.add("Three");
		stack.add("Four");
		stack.add("One");
 
		System.out.println("PEEK1 element --"+stack.peek());
		System.out.println("POP element --"+stack.pop());
		System.out.println("PEEK2 element --"+stack.peek());

		
		for (Iterator iterator = stack.iterator(); iterator.hasNext();) {
			System.out.println((String) iterator.next());
			
		}
		


	}

}
